import { Code, CreateDate, DateTime, Digdit, Entity, MemberId, Openid, PrimaryUuid, UpdateDate, Uuid } from "@sker/core";

@Entity({ name: 'gym_card_use_log' })
export class GymCardUseLog {
    @PrimaryUuid({
        primaryKeyConstraintName: "PK_GYM_CARD_USE_LOG_ID"
    })
    id: string;

    @Code({ comment: '操作, add 是退回， dec是消耗', default: 'dec' })
    operation: string;

    @DateTime({ nullable: true, comment: '取消时间' })
    cancel_time: Date;

    @Code({ comment: '状态, 0 成功 1 撤销', default: '0' })
    status: string;

    @Uuid({ comment: '领取日志Id' })
    log_id: string;

    @Uuid({ comment: '课时卡id' })
    card_id: string;

    @MemberId({ comment: '会员id' })
    member_id: string;

    @Openid({ comment: 'openid' })
    openid: string;

    @Digdit({ comment: '使用前' })
    before: number;

    @Digdit({ comment: '使用后' })
    after: string;

    @DateTime({ comment: '使用记录' })
    used_time: Date;

    @Uuid({ comment: '预约ID' })
    appointment_id: string;

    @Code({ default: 'gym_appointment', comment: 'gym_appointment or gym_activity_log', nullable: true })
    type: string;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;
}